package com.sleepfish;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * 启动程序
 * 
 * @author xiaochao
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class})
public class SleepFishApplication
{
    public static void main(String[] args) throws UnknownHostException {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        ConfigurableApplicationContext application= SpringApplication.run(SleepFishApplication.class, args);

        Environment env = application.getEnvironment();
        String ip = InetAddress.getLocalHost().getHostAddress();
        String port = env.getProperty("server.port");
        System.out.println("\n\t\tಥ_ಥ  SleepFish启动成功  ^o^y \n\n" +
                "      (\\\\___//)\n" +
                "      (⸝⸝^_~⸝⸝ )     swagger文档：http://localhost:"+port+"/doc.html\n" +
                "      ど     づ      swagger文档：http://" + ip  +":"+port+ "/doc.html\n" +
                "       しーＪ\n");
    }
}
